package cn.liwq.springboot.demo.mybatis.druid.controller;

import cn.liwq.springboot.demo.mybatis.druid.entity.User;
import cn.liwq.springboot.demo.mybatis.druid.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>Project: springboot-demo </p>
 * 
 * <p>Function:  </p>
 * 
 * <p>Description:  </p>
 *
 * @author weiqiang.li
 * 
 * @date 2018/11/21
 * 
 * @version 1.0
 */

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/all")
    public List<User> getUsers() {
        return userMapper.selectAll();
    }
}
